<?php

class Application_Model_Parkplatz
{
	protected $_parkplatzNr;
	protected $_anzahl;
	protected $_standort;
	protected $_beschreibung;
	protected $_kalenderName;
	
	
	public function __construct(array $options = null, $parkplatzNr = '', $anzahl = '', $standort = '', $beschreibung = '', $kalenderName = '')
	{
		if (is_array($options)) {
			$this->setOptions($options);
		}
	}
 
	public function __set($name, $value)
	{
		$method = 'set' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid article property');
		}
		$this->$method($value);
	}

	public function __get($name)
	{
		$method = 'get' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid article property');
		}
		return $this->$method();
	}

	public function setOptions(array $options)
	{
		$methods = get_class_methods($this);
		foreach ($options as $key => $value) {
			$method = 'set' . ucfirst($key);
			if (in_array($method, $methods)) {
				$this->$method($value);
			}
		}
		return $this;
	}
	
	
	//Parkplatznummer
	
	public function getParkplatzNr(){
		return $this->_parkplatzNr;	
	}
	
	//Testzwecke
	public function setParkplatzNr($parkplatzNr) {
		$this->_parkplatzNr = (int) $parkplatzNr;
	}
	//
	
	//Anzahl
	
	public function getAnzahl(){
		return $this->_anzahl;
	}
	
	public function setAnzahl($anzahl){
		$this->_anzahl = (int) $anzahl;
	}
	
	//Standort
	
	public function getStandort(){
		return $this->_standort;
	}
	
	public function setStandort($standort){
		$this->_standort = (string) $standort;
	}
	
	//Beschreibung
	
	public function getBeschreibung(){
		return $this->_beschreibung;
	}
	
	public function setBeschreibung($beschreibung){
		$this->_beschreibung = (string) $beschreibung;
	}
	
	//Testzwecke
	public function getKalenderName(){
		
	//	$model = new Application_Model_Parkplatz();
	//	$temp = $model->getParkplatzNr();
	//	$this->_kalenderName = "Kalender";
	//	$this->_kalenderName .= (string) $temp;
		
		return $this->_kalenderName;
	}
	
	public function setKalenderName($kalenderName){
		
	//	$model = new Application_Model_Parkplatz();
	//	$temp = $model->getParkplatzNr();
	//	$this->_kalenderName = "Kalender";
	//	$this->_kalenderName .= (string) $temp;
		
		return $this->_kalenderName = (string) $kalenderName;
	}
	//
}

